package cn.wenhaha.common.bean.dto;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;

/**
 * @ClassName: UploadFileDTO
 * @description: TODO
 * @author: wyndem
 * @date: 2020/3/19 21:02
 * @Version: 1.0
 **/
@Data
public class UploadFileDTO implements Serializable {

    private String from;
    private String input;
    private String flag;
    private Integer thumb;
    @JsonProperty("thumb_class")
    private String thumbClass;
    @JsonProperty("user_id")
    private Integer userId;
    private  MultipartFile file;
    private  MultipartFile imgFile;
    private  MultipartFile upfile;
    private  MultipartFile upload;


    public String getFrom() {
        return StrUtil.isEmpty(from)?"input":from;
    }

    public String getInput() {
        return StrUtil.isEmpty(input)?"file":input;
    }

    public String getFlag() {
        return StrUtil.isEmpty(flag)?"vod":flag;
    }

    public Integer getThumb() {
        return thumb==null?0:thumb;
    }

    public String getThumbClass() {
        return StrUtil.isEmpty(thumbClass)?"":thumbClass;
    }

    public Integer getUserId() {
        return userId==null?0:userId;
    }
}
